package com.example.bjsfpost.sap;

import com.example.bjsfpost.utils.HttpUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/bjsf/sap")
public class SapAPIInvokeController {

    @Resource
    private SapAPIInvokeService sapAPIInvokeService;
    /**
     * 物料BOM同步 ZPP_MAT_BOM_MAINTAIN
     * @param requestDTO
     * @return
     */
    @PostMapping("/zppMatBomMaintain")
    public SapCommonResponseDO zppMatBomMaintain(@RequestBody SapBomRequestDTO requestDTO){
        return sapAPIInvokeService.zppMatBomMaintain(requestDTO);
    }

    /**
     * RFC维护工艺路线 ZPP_ROUTING_MAINTAIN
     *
     * @param requestDTO
     * @return
     */
    @PostMapping("/zppRoutingMaintain")
    public SapCommonResponseDO zppRoutingMaintain(@RequestBody SapRoutingRequestDTO requestDTO){
        return sapAPIInvokeService.zppRoutingMaintain(requestDTO);
    }


}
